unit SmallStruct.Configuration.TSSActionViewConfiguration;

interface

uses Classes,
  Types,
  SmallStruct.Core,
  SmallStruct.Core.TSSObjectContainer,
  SmallStruct.Configuration.TSSConfiguration,
  SmallStruct.Configuration;

type
  TSSActionViewActionConfiguration = class(TSSConfiguration, ISSActionViewActionConfiguration)
  private
    _ActionName, _ActionCaption, _RequestActionViewName, _ActionCatalog: string;
    _IsAutoClose, _IsDisplay: Boolean;
    _Filter: TStringList;
  public
    function GetActionName: string;
    function GetActionCaption: string;
    function GetRequestActionViewName: string;
    function IsAutoClose: Boolean;
    function IsDisplay: Boolean;
  public
    function GetActionFilterName: TStrings;
    function GetActionCatalog: string;
    procedure SetActionName(const AActionName: string);
    procedure SetActionCaption(const AActionCaption: string);
    procedure SetRequestActionViewName(const ARequestActionViewName: string);
    procedure SetAutoClose(const AIsAutoClose: Boolean);
    procedure SetDisplay(const AIsDisplay: Boolean);
    procedure SetActionCatalog(const AActionCatalog: string);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

  TSSActionViewConfiguration = class(TSSConfiguration, ISSActionViewConfiguration)
  private
    _Type: TSSActionViewType;
    _ActionConfiguration: ISSObjectContainer;
    _ActionViewName, _ActionViewCaption, _ViewName: string;
  public
    function GetActionViewName: string;
    function GetActionViewCaption: string;
    function GetActionConfiguration: ISSObjectContainer;
    function GetType: TSSActionViewType;
    function GetViewName: string;
  public
    procedure SetActionViewName(const AActionViewName: string);
    procedure SetActionViewCaption(const AActionViewCaption: string);
    procedure SetType(const AType: TSSActionViewType);
    procedure SetViewName(const AViewName: string);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{ TSSActionViewConfiguration }

function TSSActionViewConfiguration.GetType: TSSActionViewType;
begin
  Result := _Type;
end;

procedure TSSActionViewConfiguration.SetActionViewCaption(const AActionViewCaption: string);
begin
  _ActionViewCaption := AActionViewCaption;
end;

procedure TSSActionViewConfiguration.SetActionViewName(const AActionViewName: string);
begin
  _ActionViewName := AActionViewName;
end;

procedure TSSActionViewConfiguration.SetType(const AType: TSSActionViewType);
begin
  _Type := AType;
end;

procedure TSSActionViewConfiguration.SetViewName(const AViewName: string);
begin
  _ViewName := AViewName;
end;

constructor TSSActionViewConfiguration.Create(AOwner: TComponent);
begin
  inherited;
  _ActionConfiguration := TSSObjectContainer.Create(Self);
end;

destructor TSSActionViewConfiguration.Destroy;
begin
  _ActionConfiguration.ReleaseObject;
  _ActionConfiguration.ReleaseObjectInstance;
  inherited;
end;

function TSSActionViewConfiguration.GetActionConfiguration: ISSObjectContainer;
begin
  Result := _ActionConfiguration;
end;

function TSSActionViewConfiguration.GetActionViewCaption: string;
begin
  Result := _ActionViewCaption;
end;

function TSSActionViewConfiguration.GetActionViewName: string;
begin
  Result := _ActionViewName;
end;

{ ISSActionViewActionConfiguration }

constructor TSSActionViewActionConfiguration.Create(AOwner: TComponent);
begin
  inherited;
  _Filter := TStringList.Create;
end;

destructor TSSActionViewActionConfiguration.Destroy;
begin
  _Filter.Free;
  inherited;
end;

function TSSActionViewActionConfiguration.GetActionCaption: string;
begin
  Result := _ActionCaption;
end;

function TSSActionViewActionConfiguration.GetActionCatalog: string;
begin
  Result := _ActionCatalog;
end;

function TSSActionViewActionConfiguration.GetActionFilterName: TStrings;
begin
  Result := _Filter;
end;

function TSSActionViewActionConfiguration.GetActionName: string;
begin
  Result := _ActionName;
end;

function TSSActionViewActionConfiguration.GetRequestActionViewName: string;
begin
  Result := _RequestActionViewName;
end;

function TSSActionViewActionConfiguration.IsAutoClose: Boolean;
begin
  Result := _IsAutoClose;
end;

function TSSActionViewActionConfiguration.IsDisplay: Boolean;
begin
  Result := _IsDisplay;
end;

procedure TSSActionViewActionConfiguration.SetAutoClose(const AIsAutoClose: Boolean);
begin
  _IsAutoClose := AIsAutoClose;
end;

procedure TSSActionViewActionConfiguration.SetRequestActionViewName(const ARequestActionViewName: string);
begin
  _RequestActionViewName := ARequestActionViewName;
end;

procedure TSSActionViewActionConfiguration.SetDisplay(const AIsDisplay: Boolean);
begin
  _IsDisplay := AIsDisplay;
end;

procedure TSSActionViewActionConfiguration.SetActionCaption(const AActionCaption: string);
begin
  _ActionCaption := AActionCaption;
end;

procedure TSSActionViewActionConfiguration.SetActionCatalog(const AActionCatalog: string);
begin
  _ActionCatalog := AActionCatalog;
end;

procedure TSSActionViewActionConfiguration.SetActionName(const AActionName: string);
begin
  _ActionName := AActionName;
end;

function TSSActionViewConfiguration.GetViewName: string;
begin
  Result := _ViewName;
end;

end.
